home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekkan Dennou Club 145
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z
/
Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin
/
tools
/
sharp
/
sxwork1i.lzh
/
SXWORK1.XDF
/
INCLUDE
/
SXGRAPH.H
< prev
next >
Wrap
Text File
|
1994-02-20
|
17KB
|
812 lines
/*
* sxgraph.h X68k SX_SYSTEM ver 2.01 Copyright 1994 SHARP/First Class Technology
*/
#ifndef __SXGRAPH_H
#define __SXGRAPH_H
#ifndef __SXDEF2_H
#include <sxdef2.h>
#endif
#ifdef FORWORD
#define __PROTO_TYPE
#endif
#ifdef __STDC__
#define __PROTO_TYPE
#endif
typedef enum TextColor TextColor;
typedef enum CapKind CapKind;
typedef enum JoinKind JoinKind;
typedef enum ScreenType ScreenType;
typedef enum FontKind FontKind;
typedef enum FontTbl FontTbl;
typedef enum GScriptCommand GScriptCommand;
typedef enum GProc GProc;
typedef enum RgnProc RgnProc;
typedef enum HProc HProc;
typedef enum FontProc FontProc;
typedef enum FontProcCommand FontProcCommand;
typedef struct Polygon Polygon;
typedef Polygon ***NPoly;
typedef struct NPolyEnv NPolyEnv;
typedef struct RectImg RectImg;
typedef struct Bits Bits;
typedef struct Pen Pen;
typedef struct TX16 TX16;
typedef struct GSOneEnv GSOneEnv;
typedef struct SpltBz SpltBz;
typedef struct SpltBSp SpltBSp;
typedef struct FontList FontList;
/*
* グラフマン(Graph Man)
*/
enum TextColor {
G_THRU,
G_WHITE = 8,
G_LGRAY,
G_DGRAY,
G_BLACK,
G_YELLOW,
G_RED,
G_GREEN,
G_BLUE
};
enum CapKind {
G_BUTTCAP,
G_ROUNDCAP,
G_PROJECTCAP
};
enum JoinKind {
G_MITERJOIN,
G_ROUNDJOIN,
G_BEVELJOIN
};
enum ScreenType {
G_TXT,
G_GRP,
G_GR2,
G_GR3
};
#define G_TXTBASE ((char *) 0xe00000)
#define G_GRPBASE ((char *) 0xc00000)
#define G_TXTLINE 128
#define G_GRPLINE 2048
#define G_TXTPAGE 0x20000
#define G_PAGE0 1
#define G_PAGE1 (1 << 1)
#define G_PAGE2 (1 << 2)
#define G_PAGE3 (1 << 3)
#define G_ALLPAGE 0x0f
#define G_GRPRATIO 0x8000
enum PenModeHi {
G_FORE,
G_BACK,
G_PPAT,
G_EXPAT
};
enum PenModeLow {
G_PSET,
G_AND,
G_OR,
G_XOR,
G_NPSET,
G_NAND,
G_NOR,
G_NXOR,
G_ADD,
G_ADDLIM,
G_SUB,
G_SUBLIM,
G_SELMAX,
G_SELMIN,
G_BLEND /* 14 */
};
enum FontKind {
G_ROM12,
G_ROM16,
G_ROM24,
G_TRAD = 128,
G_AMADEUS,
G_ARTIST,
G_BAROQUE,
G_COMP,
G_HOUSE,
G_JACK,
G_NABLA,
G_PANK,
G_SMART,
G_MG1R = 531,
G_MG4R = 534,
G_MG7R = 537,
G_KG1S = 561,
G_KG4S = 564,
G_KG7S = 567
};
#define G_PLANE 0
#define G_BOLD 1
#define G_ITALIC (1 << 1)
#define G_ULINE (1 << 2)
#define G_OLINE (1 << 3)
#define G_SHADOW (1 << 4)
#define G_KERNING (1 << 5)
enum FontTbl {
GF_HA12,
GF_ZS12,
GF_HA16,
GF_HG16,
GF_QU16,
GF_QL16,
GF_QM16,
GF_ZA16,
GF_Z116,
GF_Z216,
GF_ZG16,
GF_ZS16,
GF_HA24,
GF_HG24,
GF_QU24,
GF_QL24,
GF_QM24,
GF_ZA24,
GF_Z124,
GF_Z224,
GF_ZG24,
GF_ZS24 /* 21 */
};
enum GScriptCommand {
GS_END = -1,
GS_NOP,
GS_REM,
GS_BITMAP,
GS_APAGE,
GS_CLIP,
GS_PMODE,
GS_PSIZE,
GS_FKIND,
GS_FFACE,
GS_FMODE,
GS_FSIZE,
GS_FORE,
GS_BACK,
GS_PPAT,
GS_EXPAT,
GS_LINE,
GS_FRRECT,
GS_FLRECT,
GS_FRRRECT,
GS_FLRRECT,
GS_FROVAL,
GS_FLOVAL,
GS_FRARC,
GS_FLARC,
GS_FRPOLY,
GS_FLPOLY,
GS_FRRGN,
GS_FLRGN,
GS_STR,
GS_PUT,
GS_COPY,
GS_FRNPOLY,
GS_FLNPOLY /* 32 */
};
enum GProc {
G_STR,
G_LINE,
G_RECT,
G_RRECT,
G_OVAL,
G_ARC,
G_POLY,
G_RGN,
G_COPY,
G_RSV1,
G_RSV2,
G_WIDTH,
G_LENGTH,
G_NPOLY,
G_BEZIER,
G_BSPLINE /* 15 */
};
enum RgnProc {
GR_AND,
GR_OR,
GR_DIFF,
GR_XOR
};
enum HProc {
GH_LINE,
GH_COPY,
GH_PUT
};
enum FontProc {
GF_FACE,
GF_PUTCHAR
};
enum PlotMode {
G_STD,
G_REV,
G_HILITE,
G_HILREV,
G_ERACE,
G_MESH = 6,
G_MESREV,
G_HIDDEN,
G_HIDREV
};
enum CRTMode {
G_WS3H,
G_WS3L,
G_WS0H,
G_WS0L,
G_NS3H,
G_NS3L,
G_NS0H,
G_NS0L,
G_NM3H,
G_NM3L,
G_NM0H,
G_NM0L,
G_NL3H,
G_NL3L,
G_NL0H,
G_NL0L,
G_WS4H, /* 16 */
G_WS7V = 19
};
enum CharKind {
G_HANK,
G_HGAI,
G_QUANK,
G_QLANK,
G_ZANK = 5,
G_ZJIS1,
G_ZJIS2,
G_ZGAI,
G_ZSPC
};
struct Polygon {
long size;
Rect bounds;
LPoint pt[_VARLEN]; /* ここは可変長データの先頭 */
};
struct NPolyEnv {
long lineWidth;
CapKind capKind;
JoinKind joinKind;
long miterLimit;
};
struct RectImg {
Rect bounds;
BitImg data[_VARLEN]; /* ここは可変長データの先頭 */
};
struct GScript {
long size;
unsigned short version;
Region clipping; /* clipping は可変長データ */
/* short command[_VARLEN]; command[] も可変長データ */
};
struct Bits {
Bitmap bmap;
long size;
short lockLvl;
char rsv[16];
unsigned char data[_VARLEN]; /* ここは可変長データの先頭 */
};
struct Pen {
Point loc;
Point size;
unsigned short mode;
BitImg *pat;
};
struct TX16 {
unsigned long self;
long size;
Rect bounds;
unsigned short palet[16];
unsigned char data[_VARLEN]; /* ここは可変長データの先頭 */
};
struct GSOneEnv {
GScript **gScript;
long offset;
Rect source;
Rect dest;
Graph *graph;
};
struct SpltBz {
Point a1;
Point c1;
Point c2;
Point a2;
Point c3;
Point c4;
Point a3;
};
struct SpltBSp {
Point a1;
Point c1;
Point a2;
Point c2;
Point a3;
};
/*
* フォントマン (Font Man)
*/
enum FontProcCommand {
FP_INIT,
FP_TINI,
FP_INFO,
FP_DRAW,
FP_LENGTH,
FP_WIDTH,
FP_REV,
FP_RSV,
FP_MAX = 7
};
struct FontList {
short ID;
short type;
short motherID;
char name[26];
};
#ifdef __PROTO_TYPE
/*
* グラフマン(Graph Man)
*/
int GMOpenGraph(int, Graph *);
int GMCloseGraph(Graph *);
int GMInitGraph(Graph *);
int GMSetGraph(Graph *);
Graph *GMGetGraph(void);
int GMCopyGraph(Graph *, Graph *);
void GMMoveGraph(LPoint);
void GMSlideGraph(LPoint);
int GMSetClip(Region **);
int GMGetClip(Region **);
int GMClipRect(Rect *);
int GMSetHome(LPoint);
int GMSetGraphSize(LPoint);
int GMSetBitmap(Bitmap *);
LPoint GMLocalToGlobal(LPoint);
LPoint GMGlobalToLocal(LPoint);
void GMInitPen(void);
BOOLEAN GMPenShow(void);
BOOLEAN GMPenHide(void);
LPoint GMPenSize(LPoint);
int GMPenMode(int);
BitImg *GMPenPat(BitImg *);
BitImg *GMExPat(BitImg *);
int GMForeColor(int);
int GMBackColor(int);
int GMAPage(int);
LPoint GMGetLoc(void);
void GMGetPen(Pen *);
void GMSetPen(Pen *);
void GMInitialize(void);
void GMNullRect(Rect *);
int GMSizeRect(Rect *, LPoint);
int GMAndRects(int, Rect *, Rect *, Rect *, ...);
int GMMoveRect(Rect *, LPoint);
int GMSlideRect(Rect *, LPoint);
int GMInsetRect(Rect *, LPoint);
int GMAndRect(Rect *, Rect *, Rect *);
int GMOrRect(Rect *, Rect *, Rect *);
BOOLEAN GMPtInRect(Rect *, LPoint);
BOOLEAN GMEqualRect(Rect *, Rect *);
BOOLEAN GMEmptyRect(Rect *);
int GMAdjustRect(Rect *, Rect *, Rect *);
Region **GMNewRgn(void);
int GMDisposeRgn(Region **);
int GMOpenRgn(void);
int GMCloseRgn(Region **);
int GMNullRgn(Region **);
int GMRectRgn(Region **, Rect *);
int GMCopyRgn(Region **, Region **);
int GMMoveRgn(Region **, LPoint);
int GMSlideRgn(Region **, LPoint);
int GMInsetRgn(Region **, LPoint);
int GMAndRgn(Region **, Region **, Region **);
int GMOrRgn(Region **, Region **, Region **);
int GMDiffRgn(Region **, Region **, Region **);
int GMXorRgn(Region **, Region **, Region **);
int GMPtInRgn(Region **, LPoint);
int GMRectInRgn(Region **, Rect *);
int GMEqualRgn(Region **, Region **);
int GMEmptyRgn(Region **);
int GMImgToRgn(Region **, Bitmap *, Rect *);
int GMInitBitmap(int, Bitmap *);
void GMMove(LPoint);
void GMMoveRel(LPoint);
int GMLine(LPoint);
int GMLineRel(LPoint);
int GMFrameRect(Rect *);
int GMFillRect(Rect *);
int GMFrameOval(Rect *);
int GMFillOval(Rect *);
int GMFrameRRect(Rect *, LPoint);
int GMFillRRect(Rect *, LPoint);
int GMFrameArc(Rect *, int, int);
int GMFillArc(Rect *, int, int);
int GMFrameRgn(Region **);
int GMFillRgn(Region **);
int GMFramePoly(Polygon **);
int GMFillPoly(Polygon **);
int GMScroll(Rect *, LPoint, Region **);
int GMCopy(Bitmap *, Bitmap *, Rect *, Rect *, int, Region **);
int GMCopyMask(Bitmap *, Bitmap *, Bitmap *, Rect *, LPoint, Rect *);
int GMPlotImg(BitImg *, Rect *, int);
int GMPutRImg(RectImg *, LPoint);
int GMDupHImg(BitImg *, LPoint, int, int);
int GMDupVImg(BitImg *, LPoint, int, int);
int GMDupHRImg(RectImg *, LPoint, int);
int GMDupVRImg(RectImg *, LPoint, int);
int GMFontKind(int);
int GMFontFace(int);
int GMFontMode(int);
LPoint GMFontSize(LPoint);
int GMDrawChar(int);
int GMDrawStrL(const _LASCII);
int GMDrawStr(const char *, long, int);
int GMDrawStrZ(const char *);
long GMCharWidth(int);
long GMStrLWidth(const _LASCII);
long GMStrWidth(const char *, long, int);
int GMStrLength(const char *, long, int);
LPoint GMFontInfo(void);
int GMOpenScript(Region **);
int GMCloseScript(GScript **);
int GMDisposeScript(GScript **);
int GMDrawScript(GScript **, Rect *);
long GMGetScript(GScript **, long);
int GMOpenPoly(void);
int GMClosePoly(Polygon **);
int GMDisposePoly(Polygon **);
int GMShadowStrZ(const char *, LPoint);
int GMShadowRect(Rect *);
int GMInvertRect(Rect *, int);
int GMInvertBits(LPoint, Bitmap *);
LPoint GMMapPt(LPoint, Rect *, Rect *);
void GMMapRect(Rect *, Rect *, Rect *);
void GMMapPoly(Polygon **, Rect *, Rect *);
void GMMapRgn(Region **, Rect *, Rect *);
LPoint GMScalePt(LPoint, Rect *, Rect *);
void GMInitPalet(void);
void GMDrawG16(TX16 *, LPoint);
int GMGetPixel(Bitmap *, LPoint);
int GMCalcMask(BitImg *, BitImg *, int, int, int, int);
int GMCalcFrame(BitImg *, BitImg *, int, int, int, int);
void *SXLongMul(void *, long, long);
int SXFixRound(long);
long SXFixMul(long, long);
long SXFixDiv(int, int);
unsigned char ***GMGetFontTable(void);
void GMCopyStdProc(int (**)());
long GMStrZWidth(const char *);
int GMTransImg(Bitmap *, Bitmap *, Rect *, Rect *);
int GMFillRImg(RectImg *, LPoint);
int GMFillImg(BitImg *, Rect *);
int GMSlidedRgn(Region **, Region **, LPoint);
int GMPaintRgn(Region **, Bitmap *, LPoint);
int GMSetRgnLine(int);
int GMGetRgnLine(void);
int GMInitGraphMode(int);
int GMCurFont(void);
LPoint GMGetScrnSize(void);
Graph *GMExgGraph(Graph *);
Bitmap *GMExgBitmap(Bitmap *);
Bitmap *GMGetBitmap(void);
int GMCalcBitmap(Bitmap *);
long GMCalcScrnSize(Bitmap *);
Bits **GMNewBits(int, Rect *, int);
void GMDisposeBits(Bits **);
int GMLockBits(Bits **);
int GMUnlockBits(Bits **);
int GMItalicRect(Rect *);
int GMItalicRgn(Region **, Rect *);
void GMFreeBits(Bits **);
int GMCalcGraph(Graph *);
long GMPackImage(void *, void *, long);
long GMUnpackImage(void *, void *, long);
LPoint GMAdjustPt(LPoint, Rect *);
int GMPutImg(BitImg *, Rect *);
int GMCenterRect(Rect *, Rect *, LPoint, int);
int GMScrewRect(Rect *);
int GMAndRectRgn(Region **, Region **, Rect *);
int GMOrRectRgn(Region **, Region **, Rect *);
int GMDiffRectRgn(Region **, Region **, Rect *);
int GMXorRectRgn(Region **, Region **, Rect *);
int GMCharKind(int);
int GMDiffRgnRect(Region **, Rect *, Region **);
int (**GMGetHProcTbl(void))();
int (**GMGetStdProcTbl(void))();
int (**GMGetFontProcTbl(void))();
void (**GMGetRgnProcTbl(void))();
int GMDrawGsOne(GSOneEnv *);
int GMPtInImg(RectImg *, LPoint, int);
int GMFrameNPoly(NPoly *, NPolyEnv *);
int GMFillNPoly(NPoly *, NPolyEnv *);
Region **GMNPolyFrRgn(Region **, NPoly *, NPolyEnv *, Rect *);
Region **GMNPolyFlRgn(Region **, NPoly *, NPolyEnv *, Rect *);
BOOLEAN GMPtInNPoly(NPoly *, NPolyEnv *, LPoint);
BOOLEAN GMPtOnNPoly(NPoly *, NPolyEnv *, LPoint);
int GMRecordScript(_Handle, long, long);
int GMNLineRel(LPoint, NPolyEnv *);
int GMNLine(LPoint, NPolyEnv *);
int GMRecordPoly(LPoint);
int GMSetFlattness(int);
int GMGetFlattness(void);
int GMDrawBezier(LPoint, LPoint, LPoint);
int GMDrawBSpline(LPoint, LPoint);
int GMSplitBezier(LPoint, LPoint, LPoint, long, SpltBz *);
int GMSplitBSpline(LPoint, LPoint, long, SpltBSp *);
long GMPtOnBezier(LPoint, LPoint, LPoint, LPoint);
long GMPtOnBSpline(LPoint, LPoint, LPoint);
int GMSetGSDraw(int, int (*)());
int (*GMGetGSDraw(int))();
int GMSetGSGet(int, int (*)());
int (*GMGetGSGet(int))();
/*
* フォントマン (Font Man)
*/
int FMInit(void);
FontList *FMGetFontList(void);
int FMSetCacheSize(int);
int FMGetCacheSize(void);
int FMSetSpaceWidth(int);
int FMGetSpaceWidth(void);
int FMSetTracking(int);
int FMGetTracking(void);
int FMGetKerningWidth(int, int);
int FMFontMenuSelect(LPoint);
NPoly *FMGetFontPolyData(int);
#undef __PROTO_TYPE
#else
/*
* グラフマン(Graph Man)
*/
int GMOpenGraph();
int GMCloseGraph();
int GMInitGraph();
int GMSetGraph();
Graph *GMGetGraph();
int GMCopyGraph();
void GMMoveGraph();
void GMSlideGraph();
int GMSetClip();
int GMGetClip();
int GMClipRect();
int GMSetHome();
int GMSetGraphSize();
int GMSetBitmap();
LPoint GMLocalToGlobal();
LPoint GMGlobalToLocal();
void GMInitPen();
BOOLEAN GMPenShow();
BOOLEAN GMPenHide();
LPoint GMPenSize();
int GMPenMode();
BitImg *GMPenPat();
BitImg *GMExPat();
int GMForeColor();
int GMBackColor();
int GMAPage();
LPoint GMGetLoc();
void GMGetPen();
void GMSetPen();
void GMInitialize();
void GMNullRect();
int GMSizeRect();
int GMAndRects();
int GMMoveRect();
int GMSlideRect();
int GMInsetRect();
int GMAndRect();
int GMOrRect();
BOOLEAN GMPtInRect();
BOOLEAN GMEqualRect();
BOOLEAN GMEmptyRect();
int GMAdjustRect();
Region **GMNewRgn();
int GMDisposeRgn();
int GMOpenRgn();
int GMCloseRgn();
int GMNullRgn();
int GMRectRgn();
int GMCopyRgn();
int GMMoveRgn();
int GMSlideRgn();
int GMInsetRgn();
int GMAndRgn();
int GMOrRgn();
int GMDiffRgn();
int GMXorRgn();
int GMPtInRgn();
int GMRectInRgn();
int GMEqualRgn();
int GMEmptyRgn();
int GMImgToRgn();
int GMInitBitmap();
void GMMove();
void GMMoveRel();
int GMLine();
int GMLineRel();
int GMFrameRect();
int GMFillRect();
int GMFrameOval();
int GMFillOval();
int GMFrameRRect();
int GMFillRRect();
int GMFrameArc();
int GMFillArc();
int GMFrameRgn();
int GMFillRgn();
int GMFramePoly();
int GMFillPoly();
int GMScroll();
int GMCopy();
int GMCopyMask();
int GMPlotImg();
int GMPutRImg();
int GMDupHImg();
int GMDupVImg();
int GMDupHRImg();
int GMDupVRImg();
int GMFontKind();
int GMFontFace();
int GMFontMode();
LPoint GMFontSize();
int GMDrawChar();
int GMDrawStrL();
int GMDrawStr();
int GMDrawStrZ();
long GMCharWidth();
long GMStrLWidth();
long GMStrWidth();
int GMStrLength();
LPoint GMFontInfo();
int GMOpenScript();
int GMCloseScript();
int GMDisposeScript();
int GMDrawScript();
long GMGetScript();
int GMOpenPoly();
int GMClosePoly();
int GMDisposePoly();
int GMShadowStrZ();
int GMShadowRect();
int GMInvertRect();
int GMInvertBits();
LPoint GMMapPt();
void GMMapRect();
void GMMapPoly();
void GMMapRgn();
LPoint GMScalePt();
void GMInitPalet();
void GMDrawG16();
int GMGetPixel();
int GMCalcMask();
int GMCalcFrame();
void *SXLongMul();
int SXFixRound();
long SXFixMul();
long SXFixDiv();
unsigned char ***GMGetFontTable();
void GMCopyStdProc();
long GMStrZWidth();
int GMTransImg();
int GMFillRImg();
int GMFillImg();
int GMSlidedRgn();
int GMPaintRgn();
int GMSetRgnLine();
int GMGetRgnLine();
int GMInitGraphMode();
int GMCurFont();
LPoint GMGetScrnSize();
Graph *GMExgGraph();
Bitmap *GMExgBitmap();
Bitmap *GMGetBitmap();
int GMCalcBitmap();
long GMCalcScrnSize();
Bits **GMNewBits();
void GMDisposeBits();
int GMLockBits();
int GMUnlockBits();
int GMItalicRect();
int GMItalicRgn();
void GMFreeBits();
int GMCalcGraph();
long GMPackImage();
long GMUnpackImage();
LPoint GMAdjustPt();
int GMPutImg();
int GMCenterRect();
int GMScrewRect();
int GMAndRectRgn();
int GMOrRectRgn();
int GMDiffRectRgn();
int GMXorRectRgn();
int GMCharKind();
int GMDiffRgnRect();
int (**GMGetHProcTbl())();
int (**GMGetStdProcTbl())();
int (**GMGetFontProcTbl())();
void (**GMGetRgnProcTbl())();
int GMDrawGsOne();
int GMPtInImg();
int GMFrameNPoly();
int GMFillNPoly();
Region **GMNPolyFrRgn();
Region **GMNPolyFlRgn();
BOOLEAN GMPtInNPoly();
BOOLEAN GMPtOnNPoly();
int GMRecordScript();
int GMNLineRel();
int GMNLine();
int GMRecordPoly();
int GMSetFlattness();
int GMGetFlattness();
int GMDrawBezier();
int GMDrawBSpline();
int GMSplitBezier();
int GMSplitBSpline();
long GMPtOnBezier();
long GMPtOnBSpline();
int GMSetGSDraw();
int (*GMGetGSDraw())();
int GMSetGSGet();
int (*GMGetGSGet())();
/*
* フォントマン (Font Man)
*/
int FMInit();
FontList *FMGetFontList();
int FMSetCacheSize();
int FMGetCacheSize();
int FMSetSpaceWidth();
int FMGetSpaceWidth();
int FMSetTracking();
int FMGetTracking();
int FMGetKerningWidth();
int FMFontMenuSelect();
NPoly *FMGetFontPolyData();
#endif __PROTO_TYPE
#endif __SXGRAPH_H